package com.idas.comp.enums;

public enum ExpenseStatus {

	CANCELED, OPEN, SUBMITTED, APPROVED_BY_LECTURER, APPROVED_BY_ADMIN, PAID;
	
	public static ExpenseStatus getValue(int status) {
		switch (status) {
		case 1:
			return OPEN;
		case 2:
			return SUBMITTED;
		case 3:
			return APPROVED_BY_LECTURER;
		case 4:
			return APPROVED_BY_ADMIN;
		case 5:
			return PAID;
		}
		return CANCELED;
	}
	
	public static int getValue(ExpenseStatus status) {
		switch (status) {
		case OPEN:
			return 1;
		case SUBMITTED:
			return 2;
		case APPROVED_BY_LECTURER:
			return 3;
		case APPROVED_BY_ADMIN:
			return 4;
		case PAID:
			return 5;
		}
		return 0;
	}
	
	public static int getValue(String value) {
		return getValue(ExpenseStatus.valueOf(value.toUpperCase()));

	}
}
